/*******************************************************************************
 * Copyright 2011-2012 Dik Grapendaal
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package sh.grapendaal.tsuushin.message;

public final class MessageConstants {
	/**
	 * Some useful formatting constants. Note that italic only works in mIRC.
	 */
	public static enum Format {
		BOLD(2), COLOR(3), RESET(15), INVERT(22), ITALIC(29), ULINE(31);

		private final char value;

		private Format(int value) {
			this.value = (char) value;
		}

		/**
		 * Returns the character value of the formatting code as a string,
		 * usable in messages to IRC.
		 */
		@Override
		public String toString() {
			return Character.toString(this.value);
		}
	}

	/**
	 * The default colors as defined by mIRC.
	 */
	public static enum Color {
		WHITE(0), BLACK(1), NAVY(2), GREEN(3), RED(4), BROWN(5), PURPLE(6), ORANGE(7), YELLOW(8), LIME(9), TEAL(10),
				CYAN(11), BLUE(12), PINK(13), GREY(14), LIGHTGREY(15);

		private final int value;

		private Color(int value) {
			this.value = value;
		}

		/**
		 * Returns the color as a complete color code for IRC messages,
		 * including the prefix code.
		 */
		@Override
		public String toString() {
			return String.format(Format.COLOR + "%02d", this.value);
		}
	}
}
